<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="string" uri="http://jakarta.apache.org/taglibs/string-1.1" %>
<%@ taglib uri="/WEB-INF/tlds/pagination.tld" prefix="pagination" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <title>Dayve web</title>
    <link href="/common/css/style.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="/common/js/common.js"></script>
    <script type='text/javascript' src="/common/dwr/engine.js"></script>
    <script type='text/javascript' src="/common/dwr/util.js"></script>
    <script type="text/javascript">
        // 페이지 이동을 처리한다.
        function goListPage(page) {
            var TheForm = document.frm;
            TheForm.currentPage.value = page;
            TheForm.nextTarget.value = 'adminMemberList';
            TheForm.action = './adminMemberList.do';
            TheForm.submit();
        }

        // 검색어로 리스트를 출력한다.
        function jsSearchList() {
            var TheForm = document.frm;
            TheForm.id.value = TheForm.search_id.value;
            TheForm.nick_name.value = TheForm.search_nick_name.value;
            TheForm.email.value = TheForm.search_email.value;
            TheForm.nextTarget.value = 'adminMemberList';
            TheForm.action = './adminMemberList.do';
            TheForm.submit();
        }

        // 글쓰기 페이지로 이동 : 세션이 존재할 때만 가능
        function jsWriteBoard() {
            var TheForm = document.frm;
            TheForm.nextTarget.value = 'communityBoardWrite';
            TheForm.action = './communityBoardWrite.do';
            TheForm.submit();
        }

        // 게시물 보기 페이지로 이동
        function jsContentView() {
            var TheForm = document.frm;
            TheForm.nextTarget.value = 'communityBoardContent';
            TheForm.action = './communityBoardContent.do';
            TheForm.submit();
        }

        // Community Board List 페이지로 이동한다.
        function jsCommunityBoardList() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "communityBoardList";	// page name
            TheForm.action = "./communityBoardList.do";
            TheForm.submit();
        }

        // Photo Board List 페이지로 이동한다.
        function jsPhotoBoardList() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "photoBoardList";	// page name
            TheForm.action = "./photoBoardList.do";
            TheForm.submit();
        }

        // Notice Board List 페이지로 이동한다.
        function jsNoticeBoardList() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "noticeBoardList";	// page name
            TheForm.action = "./noticeBoardList.do";
            TheForm.submit();
        }

        // Contact Us 페이지로 이동한다.
        function jsContactUs() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "contactus";	// page name
            TheForm.action = "./contactus.do";
            TheForm.submit();
        }

        // FAQ 페이지로 이동한다.
        function jsFAQ() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "faq";	// page name
            TheForm.action = "./faq.do";
            TheForm.submit();
        }

        // 회원정보 수정 액션
        function jsUpdateAction() {
            var TheForm = document.frm;

            if(trim(TheForm.country.value) == ""){
                alert("국가를 선택하세요.");
                TheForm.country.focus();
            }else{
                if(confirm('수정하시겠습니까?')){
                    TheForm.nextTarget.value = "adminMemberList";	// page name
                    TheForm.action = "./adminMemberUpdateAction.do";
                    TheForm.submit();
                }
            }
        }

        // categoryMemberList 페이지로 이동한다.
        function jsCategoryMemberList(name) {
            var TheForm = document.frm;
            TheForm.objectName.value = name;
            TheForm.nextTarget.value = "adminCategoryMemberList";	// page name
            TheForm.action = "./adminCategoryMemberList.do";
            TheForm.submit();
        }

        // categoryMemberList 페이지로 이동한다.
        function jsItemMemberList(name) {
            var TheForm = document.frm;
            TheForm.objectName.value = name;
            TheForm.nextTarget.value = "adminItemMemberList";	// page name
            TheForm.action = "./adminItemMemberList.do";
            TheForm.submit();
        }



    </script>
</head>

<body>
<div id="wrapper">
    <!------------------------------ top 시작-------------------------------------->
    <%@include file="header.jsp" %>
    <!------------------------------ top 끝-------------------------------------->
    <div class="mypage_content">
        <form name="frm" method="POST">
            <input type="hidden" name="objectName" value="">
            <input type="hidden" name="nextTarget" value="">

            <img src="/images/intro/sub_title08.gif"  />
            <a href="admin.do"><input name="Input" class="admin_button_off" value="<spring:message code="adminStatistic.topButton1" />" /></a>
            <a href="adminMemberList.do?id&nick_name&email"><input name="Input" class="admin_button_off" value="<spring:message code="adminStatistic.topButton2" />" /></a>
            <input name="Input" class="admin_button_on" value="<spring:message code="adminStatistic.topButton3" />" />
            <p class="admin_subtitle"><spring:message code="adminStatistic.subtitle" /></p>
            <p class="contactus">
                <%--
                검색조건
                <select name="select2" size="1" id="select2" class="admin_select">
                    <option>버그</option>
                    <option>건의</option>
                    <option>일반</option>
                </select>
                --%>
            </p>
            <table class="mypage_tb">
                <tr>
                    <td width="50%" class="admin_label"><spring:message code="adminStatistic.categoryRank" /></td>
                    <td width="50%" class="admin_label"><spring:message code="adminStatistic.itemRank" /></td>
                </tr>
                <tr>
                    <td class="admin_content">
                        <%-- 카테고리 순위 --%>

                        <c:forEach items="${categoryRankList}" var="categoryRankList" varStatus="categoryStatus" begin="0" end="${categoryRankTotalCount}"
                                   step="1">

                            <a href="javascript:jsCategoryMemberList('${categoryRankList.categoryName}')">${categoryStatus.index + 1} <spring:message code="adminStatistic.rank" /> - &nbsp; ${categoryRankList.categoryName} : ${categoryRankList.amount} <spring:message code="adminStatistic.num" /> <br/></a>

                        </c:forEach>
                    </td>
                    <td class="admin_content">
                        <%-- 아이템 순위 --%>

                        <c:forEach items="${itemRankList}" var="itemRankList" varStatus="itemStatus" begin="0" end="${itemRankTotalCount}"
                                   step="1">

                            <a href="javascript:jsItemMemberList('${itemRankList.itemName}')">${itemStatus.index + 1} <spring:message code="adminStatistic.rank" /> - &nbsp; ${itemRankList.itemName} : ${itemRankList.amount} <spring:message code="adminStatistic.num" /> <br/></a>

                        </c:forEach>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <!------------------------------ 하위메뉴 시작-------------------------------------->
    <%@include file="footer.jsp" %>
    <!------------------------------ 하위메뉴 끝-------------------------------------->
</div>
</body>
</html>
